/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package scheduled;

import ejb.TicketManager;
import java.util.Date;
import javax.annotation.security.RunAs;
import javax.ejb.EJB;
import javax.ejb.Schedule;
import javax.ejb.Singleton;


@Singleton
public class MailExport {
    
    private long startTime = System.currentTimeMillis();
    
    @EJB
    private TicketManager tm;
  
    @Schedule(second="0", minute="0/1",hour="*", persistent=false)
    public void run() {
        long diff = System.currentTimeMillis()-startTime;
        long seconds = (diff/1000)%60;
        long minutes = (diff/60000)%60;
        long hours = (diff/3600000)%24;
        long days = diff/86400000;
        System.out.println("Server running for: "
                +(days == 0 ? "" : days+" days ")
                +(hours == 0 ? "" : hours+" hours ")
                +(minutes == 0 ? "" : minutes+" minutes ")
                +(seconds == 0 ? "" : seconds+" seconds "));
    }
}
